import request from '@/utils/request'

// 获取员工列表
export const getYuangongList = (params) => request({
  url: '/sys/user',
  params
})

// excel导出 二进制文件
export const exportEmployee = () => request({
  url: '/sys/user/export',
  // 指定响应数据格式
  responseType:'blob'
})

// excel员工模板下载导入
export const EmployeeModule = () => request({
  url: '/sys/user/import/template',
    responseType:'blob'
})


// 导入员工模板
export const importEmloyee = (data) => request({
  url: '/sys/user/import',
  method: 'POST',
  data
})

// 删除
export const delEmPloyee = id => request({
  url: `/sys/user/${id}`,
  method:'DELETE'
})


// 新增员工
export const addEmployee = data => request({
  url: '/sys/user',
  method: 'POST',
  data
})

// 获取员工信息
export const getEmployeeInfo = id => request({
  url:`/sys/user/${id}`
})

// 修改员工
export const updateInfo = data => request({
  url: `/sys/user/${data.id}`,
  method:'PUT',
  data
})

// 给员工分配角色权限的接口
export const assginRoles = data => request({
  url: '/sys/user/assignRoles',
  method: 'PUT',
  data
})